  <template>
  <div class="error">
    <div v-if="error.statusCode == 404">
      <h2>页面不存在</h2>
      <button @click="goLogin">跳转登陆页面</button>
    </div>
    <div v-else>
      <h2>~服务器出错了</h2>
      <button @click="goLogin">重新登录</button>
    </div>
  </div>
</template>
<script>
export default {
  props: ["error"],
  components: {},
  data() {
    return {};
  },
  mounted: function() {},

  methods: {
    goLogin() {
      this.$router.replace({
        path: "../login/msgLogin"
      });
    }
  }
};
</script>

<style scoped lang="less">
.error {
  width: 100%;
  height: 100vh;
  background: #fff;
}
h2 {
  font-size: 0.3rem;
  text-align: center;
  margin-top: 3rem;
}
button {
  display: block;
  width: 5rem;
  height: 0.88rem;
  text-align: center;
  line-height: 0.88rem;
  font-size: 0.3rem;
  outline: none;
  border: none;
  margin: 1rem auto;
  background: #80d566;
  border-radius: 0.44rem;
  color: #fff;
}
</style>
